<template>
<el-form :model="reCollModel" ref="reCollForm" :inline="true" label-width="72px" :label-position="'left'">
  <el-row class="search-title">条件搜索</el-row>
  <el-form-item prop="parkname">
    <el-input v-model="reCollModel.parkName" prefix-icon="el-icon-search" clearable placeholder="车场名称/拼音首字母"></el-input>
  </el-form-item>
  <el-form-item> <el-button class="btn-search" type="primary"  @click="handleQueryReColl">搜索
  </el-button></el-form-item>
  <collapse-vertical>
    <div v-show="isDisplay">
        <!--<el-row>-->
        <!--<el-form-item prop="parentorgname" label="经营单位">-->
          <!--<el-input  @click.native="handleSelectDwNameReColl" clearable  readonly-->
                    <!--placeholder="经营单位"></el-input>-->
        <!--</el-form-item>-->
        <!--</el-row>-->
      <el-form-item prop="rangeTime">
        <el-date-picker
          v-model="reCollModel.rangeTime" type="datetimerange" align="right" unlink-panels range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
          :picker-options="pickerOptions" clearable value-format="yyyy-MM-dd HH:mm:ss">
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button class="btn-mini-form" type="primary" style="color: white" @click="handleQueryReColl"
                   size="mini" >提交
        </el-button>
        <el-button class="btn-mini-form" type="primary" style="color: white" @click="handleResetReColl"
                   size="mini" >重置
        </el-button>
      </el-form-item>
    </div>
  </collapse-vertical>
  <el-row style="text-align: center">
    <el-button style="border: none;background-color: transparent" size="small"
               @click="isShow" :icon="isDisplay?'el-icon-arrow-up':'el-icon-arrow-down'">
    </el-button>
  </el-row>
  <dialog-d-w :dialogSelectDWVisible.sync="dialogDWvisible"></dialog-d-w>
</el-form>
  </template>
<script>
  /* eslint-disable */
  import CollapseVertical from '../../../utils/collapseVertical'
  import DialogDW from "./dialogDW";
  export default {
    components: {DialogDW,CollapseVertical},
    name: "re-coll-form",
    data(){
      return{
        pickerOptions: {
          shortcuts: [{
            text: '最近一周',
            onClick(picker) {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
              picker.$emit('pick', [start, end])
            }
          }, {
            text: '最近一个月',
            onClick(picker) {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
              picker.$emit('pick', [start, end])
            }
          }, {
            text: '最近三个月',
            onClick(picker) {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
              picker.$emit('pick', [start, end])
            }
          }]
        },
        isDisplay:false,
        dialogDWvisible:false,

        reCollModel:{
          parkName:'',
          rangeTime:[]
         // startdate:this.rangeTime[0],
         // enddate:this.rangeTime[1],
        }

      }
    },
    methods:{
      handleQueryReColl(){
        this.$emit('handleQueryReColl', this.reCollModel)
      },
      handleSelectDwNameReColl(){
        this.dialogDWvisible=true
      },
      handleResetReColl(){
        this.$refs['reCollForm'].resetFields()
      },
      isShow(){
        this.isDisplay =!this.isDisplay
      }
    }
  }
</script>

<style scoped>

</style>
